package com.jh.user.repository;

import com.jh.user.pojo.ChannelConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;


@Repository
public interface ChannelConfigRepository extends
        JpaRepository<ChannelConfig,String>,
        JpaSpecificationExecutor<ChannelConfig>{


        @Query(nativeQuery = true, value = "select a.* from t_channel_config a inner join t_terminal_info t on t.id = a.terminal_id where t.terminal_no =:terminalNo")
        ChannelConfig findByTerminalNo(@Param("terminalNo") String terminalNo);

        ChannelConfig findById(Long id);


}
